﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;
using TiaoTaoHelper.Wtm.Units.EFCore;

#nullable disable

namespace HengTong.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class 人事招聘日常活动访客业务表初步初始化 : TransactionalMigration
    {
        /// <inheritdoc />
        protected override void UpWithTransaction(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "SysActivityList",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    ActivityName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
                    StartTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EndTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsActive = table.Column<int>(type: "int", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysActivityList", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "SysDailyLeaveRequestBill",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    StaffNo = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    LeaveType = table.Column<int>(type: "int", nullable: true),
                    StartTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EndTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Days = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Approver = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ApprovalTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    BillCode = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BillStatus = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysDailyLeaveRequestBill", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysDailyLeaveRequestBill_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysDailyOutFactoryRequestBill",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    StaffNo = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    OutFactoryTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ExpectedReturnTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Reason = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Approver = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ApprovalTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    BillCode = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BillStatus = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysDailyOutFactoryRequestBill", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysDailyOutFactoryRequestBill_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysHrRecruitRequestBill",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Approver = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ApprovalTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    BillCode = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BillStatus = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysHrRecruitRequestBill", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysHrRecruitRequestBill_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysHrResignRequestBill",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    StaffNo = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    ResignType = table.Column<int>(type: "int", nullable: true),
                    ResignDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ResignReason = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Approver = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ApprovalTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    BillCode = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BillStatus = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysHrResignRequestBill", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysHrResignRequestBill_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysHrRetireRequestBill",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    StaffNo = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    RetireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ResignType = table.Column<int>(type: "int", nullable: true),
                    Describe = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Approver = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ApprovalTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    BillCode = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BillStatus = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysHrRetireRequestBill", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysHrRetireRequestBill_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysHrStaffNeedRequestBill",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Approver = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ApprovalTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    BillCode = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BillStatus = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysHrStaffNeedRequestBill", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysHrStaffNeedRequestBill_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysPersonMedicalExam",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    BatchName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    MedicalType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    Hospital = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    MedicalDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPersonMedicalExam", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "SysPersonTrain",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    TrainName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    TrainStartDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    TrainEndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ExamDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPersonTrain", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "SysSmsAuthLog",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Phone = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
                    Context = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true),
                    State = table.Column<int>(type: "int", nullable: false),
                    Message = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SmsTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysSmsAuthLog", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "SysVisitorInformation",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    Phone = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true),
                    IdCardNo = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
                    IdCardFrontPhotoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    IdCardBackPhotoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    Company = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    CarNo = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true),
                    WechatUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                    IsBlack = table.Column<bool>(type: "bit", nullable: false),
                    BlackReason = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysVisitorInformation", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysVisitorInformation_FileAttachments_IdCardFrontPhotoId",
                        column: x => x.IdCardFrontPhotoId,
                        principalTable: "FileAttachments",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_SysVisitorInformation_SysWechatUser_WechatUserId",
                        column: x => x.WechatUserId,
                        principalTable: "SysWechatUser",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysVisitorReason",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    ReasonName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    IsActive = table.Column<int>(type: "int", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysVisitorReason", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysVisitorReason_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysActivityParticipation",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    ActivityId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    ParticipantType = table.Column<int>(type: "int", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
                    Phone = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true),
                    Address = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                    Description = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
                    WechatUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysActivityParticipation", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysActivityParticipation_SysActivityList_ActivityId",
                        column: x => x.ActivityId,
                        principalTable: "SysActivityList",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_SysActivityParticipation_SysWechatUser_WechatUserId",
                        column: x => x.WechatUserId,
                        principalTable: "SysWechatUser",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysHrStaffNeedRequestBillEntry",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    HireNumber = table.Column<int>(type: "int", nullable: false),
                    ApplyReason = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
                    ExpectedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    JobRequirement = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    EducationRequirement = table.Column<int>(type: "int", nullable: true),
                    MajorRequirement = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    GenderRequirement = table.Column<int>(type: "int", nullable: true),
                    AgeRequirement = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    OtherRequirement = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    JobPositionId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    HrStaffNeedId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysHrStaffNeedRequestBillEntry", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysHrStaffNeedRequestBillEntry_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysHrStaffNeedRequestBillEntry_SysHrStaffNeedRequestBill_HrStaffNeedId",
                        column: x => x.HrStaffNeedId,
                        principalTable: "SysHrStaffNeedRequestBill",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysHrStaffNeedRequestBillEntry_SysJobPosition_JobPositionId",
                        column: x => x.JobPositionId,
                        principalTable: "SysJobPosition",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysVisitorRecordRequestBill",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    VisitorReasonId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    Phone = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true),
                    IdCardNo = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
                    IdCardFrontPhotoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    IdCardBackPhotoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    Company = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    CarNo = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true),
                    WechatUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    ReservationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Receptionist = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ReceptionistPhone = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    RejectReason = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                    EntryTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LeaveTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Approver = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ApprovalTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    BillCode = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BillStatus = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysVisitorRecordRequestBill", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysVisitorRecordRequestBill_FileAttachments_IdCardFrontPhotoId",
                        column: x => x.IdCardFrontPhotoId,
                        principalTable: "FileAttachments",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_SysVisitorRecordRequestBill_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysVisitorRecordRequestBill_SysVisitorReason_VisitorReasonId",
                        column: x => x.VisitorReasonId,
                        principalTable: "SysVisitorReason",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_SysVisitorRecordRequestBill_SysWechatUser_WechatUserId",
                        column: x => x.WechatUserId,
                        principalTable: "SysWechatUser",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysActivitImages",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    ActivityParticipationId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    FileId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Order = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysActivitImages", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysActivitImages_FileAttachments_FileId",
                        column: x => x.FileId,
                        principalTable: "FileAttachments",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_SysActivitImages_SysActivityParticipation_ActivityParticipationId",
                        column: x => x.ActivityParticipationId,
                        principalTable: "SysActivityParticipation",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateTable(
                name: "SysHrStaffPool",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    StaffNeedEntryId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    HrStatus = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysHrStaffPool", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysHrStaffPool_SysHrStaffNeedRequestBillEntry_StaffNeedEntryId",
                        column: x => x.StaffNeedEntryId,
                        principalTable: "SysHrStaffNeedRequestBillEntry",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysHrRecruitRequestBillEntry",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    StaffPoolId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    RecruitId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    RecruitRequestBillID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    RecruitCount = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysHrRecruitRequestBillEntry", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysHrRecruitRequestBillEntry_SysHrRecruitRequestBill_RecruitRequestBillID",
                        column: x => x.RecruitRequestBillID,
                        principalTable: "SysHrRecruitRequestBill",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysHrRecruitRequestBillEntry_SysHrStaffPool_StaffPoolId",
                        column: x => x.StaffPoolId,
                        principalTable: "SysHrStaffPool",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysHrRecruitPool",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    RecruitSubId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    RecruitRequestBillEntryID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    HrStatus = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysHrRecruitPool", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysHrRecruitPool_SysHrRecruitRequestBillEntry_RecruitRequestBillEntryID",
                        column: x => x.RecruitRequestBillEntryID,
                        principalTable: "SysHrRecruitRequestBillEntry",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysHrDismissRequestBill",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    PersonId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    DismissDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ResignType = table.Column<int>(type: "int", nullable: true),
                    Describe = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Approver = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ApprovalTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    BillCode = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BillStatus = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysHrDismissRequestBill", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysHrDismissRequestBill_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysHrInterviewPool",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    InterviewRequestBillId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    HrStatus = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysHrInterviewPool", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "SysHrRenewRequestBill",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    PersonContractId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    EmploymentType = table.Column<int>(type: "int", nullable: true),
                    ContractType = table.Column<int>(type: "int", nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    SignDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ContractFileId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Approver = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ApprovalTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    BillCode = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BillStatus = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysHrRenewRequestBill", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysHrRenewRequestBill_FileAttachments_ContractFileId",
                        column: x => x.ContractFileId,
                        principalTable: "FileAttachments",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_SysHrRenewRequestBill_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysHrTransferRequestBill",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    PersonId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    ApplyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EffectiveDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    TransferType = table.Column<int>(type: "int", nullable: true),
                    OriginalGroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    OriginalPositionId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    OriginalRank = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    OriginalBaseSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    OriginalPositionSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    OriginalPerformanceSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    NewGroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    NewPositionId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    NewRank = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    NewBaseSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    NewPositionSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    NewPerformanceSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    TransferReason = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Approver = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ApprovalTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    BillCode = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BillStatus = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysHrTransferRequestBill", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysHrTransferRequestBill_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysHrTransferRequestBill_FrameworkGroups_NewGroupId",
                        column: x => x.NewGroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysHrTransferRequestBill_FrameworkGroups_OriginalGroupId",
                        column: x => x.OriginalGroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysHrTransferRequestBill_SysJobPosition_NewPositionId",
                        column: x => x.NewPositionId,
                        principalTable: "SysJobPosition",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysHrTransferRequestBill_SysJobPosition_OriginalPositionId",
                        column: x => x.OriginalPositionId,
                        principalTable: "SysJobPosition",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysPerson",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
                    StaffNo = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
                    BirthDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Age = table.Column<int>(type: "int", nullable: true),
                    Gender = table.Column<int>(type: "int", nullable: false),
                    Ethnicity = table.Column<int>(type: "int", nullable: true),
                    HighestEducation = table.Column<int>(type: "int", nullable: true),
                    MaritalStatus = table.Column<int>(type: "int", nullable: true),
                    PhotoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    IdCardNo = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: false),
                    IdCardFrontPhotoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    IdCardBackPhotoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    HouseholdRegistration = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    NativePlace = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    PoliticalStatus = table.Column<int>(type: "int", nullable: true),
                    PartyJoinDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PartyBranch = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    ArchiveLocation = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    ArchiveNo = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    ArchiveTransferOutDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ArchiveTransferInDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    HomeAddress = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    Phone = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true),
                    Email = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    SalaryBank = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    SalaryAccount = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BonusBank = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BonusAccount = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    JobPositionId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    ResumeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    HireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ConfirmationDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EmploymentType = table.Column<int>(type: "int", nullable: true),
                    ContractType = table.Column<int>(type: "int", nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ContractStartDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ContractEndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ResignationDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ResignationReason = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    ResignationType = table.Column<int>(type: "int", nullable: true),
                    State = table.Column<int>(type: "int", nullable: true),
                    BloodType = table.Column<int>(type: "int", nullable: true),
                    Hobbies = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    Discriminator = table.Column<string>(type: "nvarchar(34)", maxLength: 34, nullable: false),
                    RecruitNo = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    ArrivalDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CurrentSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ExpectedSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    WorkExperience = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    InitialTestTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    InitialResult = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    InitialComment = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    ReExamTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ReExamResult = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    ReExamComment = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    FinalResult = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    FinalRemark = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    RejectReason = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    EntryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    RegDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProbationStartDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProbationEndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProbationSalary = table.Column<decimal>(type: "decimal(18,2)", maxLength: 128, nullable: true),
                    RegularSalary = table.Column<decimal>(type: "decimal(18,2)", maxLength: 128, nullable: true),
                    JobContent = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    JobAchievements = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    Remarks = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    RegOpinion = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    BillCode = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    BillStatus = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
                    Approver = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    ApprovalTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PersonMedicalId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    TrainExamId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    SysPersonTrainExamID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPerson", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysPerson_FileAttachments_IdCardBackPhotoId",
                        column: x => x.IdCardBackPhotoId,
                        principalTable: "FileAttachments",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_SysPerson_FileAttachments_IdCardFrontPhotoId",
                        column: x => x.IdCardFrontPhotoId,
                        principalTable: "FileAttachments",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_SysPerson_FileAttachments_PhotoId",
                        column: x => x.PhotoId,
                        principalTable: "FileAttachments",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_SysPerson_FileAttachments_ResumeId",
                        column: x => x.ResumeId,
                        principalTable: "FileAttachments",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_SysPerson_FrameworkGroups_GroupId",
                        column: x => x.GroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysPerson_SysJobPosition_JobPositionId",
                        column: x => x.JobPositionId,
                        principalTable: "SysJobPosition",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysPersonContract",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    PersonId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    RequestBillId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    EmploymentType = table.Column<int>(type: "int", nullable: true),
                    ContractType = table.Column<int>(type: "int", nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    SignDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ContractCount = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPersonContract", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysPersonContract_SysPerson_PersonId",
                        column: x => x.PersonId,
                        principalTable: "SysPerson",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysPersonEducation",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    PersonId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    School = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
                    Major = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    EducationLevel = table.Column<int>(type: "int", nullable: true),
                    EducationSystem = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    EnrollmentDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    GraduationDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPersonEducation", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysPersonEducation_SysPerson_PersonId",
                        column: x => x.PersonId,
                        principalTable: "SysPerson",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysPersonFamily",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    PersonId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    MemberName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
                    Ethnicity = table.Column<int>(type: "int", nullable: true),
                    BirthDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    WorkOrSchool = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    JobOrGrade = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    ContactPhone = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true),
                    RelationshipType = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPersonFamily", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysPersonFamily_SysPerson_PersonId",
                        column: x => x.PersonId,
                        principalTable: "SysPerson",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysPersonMedical",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    PersonId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    MedicalExamId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    Result = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                    MedicalReportId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPersonMedical", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysPersonMedical_FileAttachments_MedicalReportId",
                        column: x => x.MedicalReportId,
                        principalTable: "FileAttachments",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_SysPersonMedical_SysPersonMedicalExam_MedicalExamId",
                        column: x => x.MedicalExamId,
                        principalTable: "SysPersonMedicalExam",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysPersonMedical_SysPerson_PersonId",
                        column: x => x.PersonId,
                        principalTable: "SysPerson",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysPersonResume",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    PersonId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    TransferRequestId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    ResumeType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
                    StartDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    OriginalGroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    OriginalPositionId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    OriginalRank = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    OriginalBaseSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    OriginalPositionSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    OriginalPerformanceSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    NewGroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    NewPositionId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    NewRank = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    NewBaseSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    NewPositionSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    NewPerformanceSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    TransferReason = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPersonResume", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysPersonResume_FrameworkGroups_NewGroupId",
                        column: x => x.NewGroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysPersonResume_FrameworkGroups_OriginalGroupId",
                        column: x => x.OriginalGroupId,
                        principalTable: "FrameworkGroups",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysPersonResume_SysHrTransferRequestBill_TransferRequestId",
                        column: x => x.TransferRequestId,
                        principalTable: "SysHrTransferRequestBill",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysPersonResume_SysJobPosition_NewPositionId",
                        column: x => x.NewPositionId,
                        principalTable: "SysJobPosition",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysPersonResume_SysJobPosition_OriginalPositionId",
                        column: x => x.OriginalPositionId,
                        principalTable: "SysJobPosition",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysPersonResume_SysPerson_PersonId",
                        column: x => x.PersonId,
                        principalTable: "SysPerson",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysPersonTrainExam",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    PersonId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    SysTrainId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    SysPersonTrainID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    Score = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ScoreReportId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPersonTrainExam", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysPersonTrainExam_FileAttachments_ScoreReportId",
                        column: x => x.ScoreReportId,
                        principalTable: "FileAttachments",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_SysPersonTrainExam_SysPersonTrain_SysPersonTrainID",
                        column: x => x.SysPersonTrainID,
                        principalTable: "SysPersonTrain",
                        principalColumn: "ID");
                    table.ForeignKey(
                        name: "FK_SysPersonTrainExam_SysPerson_PersonId",
                        column: x => x.PersonId,
                        principalTable: "SysPerson",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysPersonWork",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    PersonId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    Company = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
                    Position = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    StartDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Reference = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPersonWork", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysPersonWork_SysPerson_PersonId",
                        column: x => x.PersonId,
                        principalTable: "SysPerson",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateTable(
                name: "SysPersonContractFile",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    PersonContractId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    FileId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Order = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysPersonContractFile", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysPersonContractFile_FileAttachments_FileId",
                        column: x => x.FileId,
                        principalTable: "FileAttachments",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_SysPersonContractFile_SysPersonContract_PersonContractId",
                        column: x => x.PersonContractId,
                        principalTable: "SysPersonContract",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateIndex(
                name: "IX_SysActivitImages_ActivityParticipationId",
                table: "SysActivitImages",
                column: "ActivityParticipationId");

            migrationBuilder.CreateIndex(
                name: "IX_SysActivitImages_FileId",
                table: "SysActivitImages",
                column: "FileId");

            migrationBuilder.CreateIndex(
                name: "IX_SysActivityParticipation_ActivityId",
                table: "SysActivityParticipation",
                column: "ActivityId");

            migrationBuilder.CreateIndex(
                name: "IX_SysActivityParticipation_WechatUserId",
                table: "SysActivityParticipation",
                column: "WechatUserId");

            migrationBuilder.CreateIndex(
                name: "IX_SysDailyLeaveRequestBill_GroupId",
                table: "SysDailyLeaveRequestBill",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysDailyOutFactoryRequestBill_GroupId",
                table: "SysDailyOutFactoryRequestBill",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrDismissRequestBill_GroupId",
                table: "SysHrDismissRequestBill",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrDismissRequestBill_PersonId",
                table: "SysHrDismissRequestBill",
                column: "PersonId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrInterviewPool_InterviewRequestBillId",
                table: "SysHrInterviewPool",
                column: "InterviewRequestBillId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrRecruitPool_RecruitRequestBillEntryID",
                table: "SysHrRecruitPool",
                column: "RecruitRequestBillEntryID");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrRecruitRequestBill_GroupId",
                table: "SysHrRecruitRequestBill",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrRecruitRequestBillEntry_RecruitRequestBillID",
                table: "SysHrRecruitRequestBillEntry",
                column: "RecruitRequestBillID");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrRecruitRequestBillEntry_StaffPoolId",
                table: "SysHrRecruitRequestBillEntry",
                column: "StaffPoolId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrRenewRequestBill_ContractFileId",
                table: "SysHrRenewRequestBill",
                column: "ContractFileId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrRenewRequestBill_GroupId",
                table: "SysHrRenewRequestBill",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrRenewRequestBill_PersonContractId",
                table: "SysHrRenewRequestBill",
                column: "PersonContractId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrResignRequestBill_GroupId",
                table: "SysHrResignRequestBill",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrRetireRequestBill_GroupId",
                table: "SysHrRetireRequestBill",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrStaffNeedRequestBill_GroupId",
                table: "SysHrStaffNeedRequestBill",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrStaffNeedRequestBillEntry_GroupId",
                table: "SysHrStaffNeedRequestBillEntry",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrStaffNeedRequestBillEntry_HrStaffNeedId",
                table: "SysHrStaffNeedRequestBillEntry",
                column: "HrStaffNeedId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrStaffNeedRequestBillEntry_JobPositionId",
                table: "SysHrStaffNeedRequestBillEntry",
                column: "JobPositionId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrStaffPool_StaffNeedEntryId",
                table: "SysHrStaffPool",
                column: "StaffNeedEntryId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrTransferRequestBill_GroupId",
                table: "SysHrTransferRequestBill",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrTransferRequestBill_NewGroupId",
                table: "SysHrTransferRequestBill",
                column: "NewGroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrTransferRequestBill_NewPositionId",
                table: "SysHrTransferRequestBill",
                column: "NewPositionId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrTransferRequestBill_OriginalGroupId",
                table: "SysHrTransferRequestBill",
                column: "OriginalGroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrTransferRequestBill_OriginalPositionId",
                table: "SysHrTransferRequestBill",
                column: "OriginalPositionId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrTransferRequestBill_PersonId",
                table: "SysHrTransferRequestBill",
                column: "PersonId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPerson_GroupId",
                table: "SysPerson",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPerson_IdCardBackPhotoId",
                table: "SysPerson",
                column: "IdCardBackPhotoId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPerson_IdCardFrontPhotoId",
                table: "SysPerson",
                column: "IdCardFrontPhotoId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPerson_JobPositionId",
                table: "SysPerson",
                column: "JobPositionId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPerson_PersonMedicalId",
                table: "SysPerson",
                column: "PersonMedicalId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPerson_PhotoId",
                table: "SysPerson",
                column: "PhotoId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPerson_ResumeId",
                table: "SysPerson",
                column: "ResumeId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPerson_SysPersonTrainExamID",
                table: "SysPerson",
                column: "SysPersonTrainExamID");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonContract_PersonId",
                table: "SysPersonContract",
                column: "PersonId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonContractFile_FileId",
                table: "SysPersonContractFile",
                column: "FileId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonContractFile_PersonContractId",
                table: "SysPersonContractFile",
                column: "PersonContractId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonEducation_PersonId",
                table: "SysPersonEducation",
                column: "PersonId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonFamily_PersonId",
                table: "SysPersonFamily",
                column: "PersonId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonMedical_MedicalExamId",
                table: "SysPersonMedical",
                column: "MedicalExamId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonMedical_MedicalReportId",
                table: "SysPersonMedical",
                column: "MedicalReportId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonMedical_PersonId",
                table: "SysPersonMedical",
                column: "PersonId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonResume_NewGroupId",
                table: "SysPersonResume",
                column: "NewGroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonResume_NewPositionId",
                table: "SysPersonResume",
                column: "NewPositionId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonResume_OriginalGroupId",
                table: "SysPersonResume",
                column: "OriginalGroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonResume_OriginalPositionId",
                table: "SysPersonResume",
                column: "OriginalPositionId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonResume_PersonId",
                table: "SysPersonResume",
                column: "PersonId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonResume_TransferRequestId",
                table: "SysPersonResume",
                column: "TransferRequestId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonTrainExam_PersonId",
                table: "SysPersonTrainExam",
                column: "PersonId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonTrainExam_ScoreReportId",
                table: "SysPersonTrainExam",
                column: "ScoreReportId");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonTrainExam_SysPersonTrainID",
                table: "SysPersonTrainExam",
                column: "SysPersonTrainID");

            migrationBuilder.CreateIndex(
                name: "IX_SysPersonWork_PersonId",
                table: "SysPersonWork",
                column: "PersonId");

            migrationBuilder.CreateIndex(
                name: "IX_SysVisitorInformation_IdCardFrontPhotoId",
                table: "SysVisitorInformation",
                column: "IdCardFrontPhotoId");

            migrationBuilder.CreateIndex(
                name: "IX_SysVisitorInformation_WechatUserId",
                table: "SysVisitorInformation",
                column: "WechatUserId");

            migrationBuilder.CreateIndex(
                name: "IX_SysVisitorReason_GroupId",
                table: "SysVisitorReason",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysVisitorRecordRequestBill_GroupId",
                table: "SysVisitorRecordRequestBill",
                column: "GroupId");

            migrationBuilder.CreateIndex(
                name: "IX_SysVisitorRecordRequestBill_IdCardFrontPhotoId",
                table: "SysVisitorRecordRequestBill",
                column: "IdCardFrontPhotoId");

            migrationBuilder.CreateIndex(
                name: "IX_SysVisitorRecordRequestBill_VisitorReasonId",
                table: "SysVisitorRecordRequestBill",
                column: "VisitorReasonId");

            migrationBuilder.CreateIndex(
                name: "IX_SysVisitorRecordRequestBill_WechatUserId",
                table: "SysVisitorRecordRequestBill",
                column: "WechatUserId");

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrDismissRequestBill_SysPerson_PersonId",
                table: "SysHrDismissRequestBill",
                column: "PersonId",
                principalTable: "SysPerson",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrInterviewPool_SysPerson_InterviewRequestBillId",
                table: "SysHrInterviewPool",
                column: "InterviewRequestBillId",
                principalTable: "SysPerson",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrRenewRequestBill_SysPersonContract_PersonContractId",
                table: "SysHrRenewRequestBill",
                column: "PersonContractId",
                principalTable: "SysPersonContract",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrTransferRequestBill_SysPerson_PersonId",
                table: "SysHrTransferRequestBill",
                column: "PersonId",
                principalTable: "SysPerson",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysPerson_SysPersonMedical_PersonMedicalId",
                table: "SysPerson",
                column: "PersonMedicalId",
                principalTable: "SysPersonMedical",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysPerson_SysPersonTrainExam_SysPersonTrainExamID",
                table: "SysPerson",
                column: "SysPersonTrainExamID",
                principalTable: "SysPersonTrainExam",
                principalColumn: "ID");
        }

        /// <inheritdoc />
        protected override void DownWithTransaction(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_SysPersonMedical_SysPerson_PersonId",
                table: "SysPersonMedical");

            migrationBuilder.DropForeignKey(
                name: "FK_SysPersonTrainExam_SysPerson_PersonId",
                table: "SysPersonTrainExam");

            migrationBuilder.DropTable(
                name: "SysActivitImages");

            migrationBuilder.DropTable(
                name: "SysDailyLeaveRequestBill");

            migrationBuilder.DropTable(
                name: "SysDailyOutFactoryRequestBill");

            migrationBuilder.DropTable(
                name: "SysHrDismissRequestBill");

            migrationBuilder.DropTable(
                name: "SysHrInterviewPool");

            migrationBuilder.DropTable(
                name: "SysHrRecruitPool");

            migrationBuilder.DropTable(
                name: "SysHrRenewRequestBill");

            migrationBuilder.DropTable(
                name: "SysHrResignRequestBill");

            migrationBuilder.DropTable(
                name: "SysHrRetireRequestBill");

            migrationBuilder.DropTable(
                name: "SysPersonContractFile");

            migrationBuilder.DropTable(
                name: "SysPersonEducation");

            migrationBuilder.DropTable(
                name: "SysPersonFamily");

            migrationBuilder.DropTable(
                name: "SysPersonResume");

            migrationBuilder.DropTable(
                name: "SysPersonWork");

            migrationBuilder.DropTable(
                name: "SysSmsAuthLog");

            migrationBuilder.DropTable(
                name: "SysVisitorInformation");

            migrationBuilder.DropTable(
                name: "SysVisitorRecordRequestBill");

            migrationBuilder.DropTable(
                name: "SysActivityParticipation");

            migrationBuilder.DropTable(
                name: "SysHrRecruitRequestBillEntry");

            migrationBuilder.DropTable(
                name: "SysPersonContract");

            migrationBuilder.DropTable(
                name: "SysHrTransferRequestBill");

            migrationBuilder.DropTable(
                name: "SysVisitorReason");

            migrationBuilder.DropTable(
                name: "SysActivityList");

            migrationBuilder.DropTable(
                name: "SysHrRecruitRequestBill");

            migrationBuilder.DropTable(
                name: "SysHrStaffPool");

            migrationBuilder.DropTable(
                name: "SysHrStaffNeedRequestBillEntry");

            migrationBuilder.DropTable(
                name: "SysHrStaffNeedRequestBill");

            migrationBuilder.DropTable(
                name: "SysPerson");

            migrationBuilder.DropTable(
                name: "SysPersonMedical");

            migrationBuilder.DropTable(
                name: "SysPersonTrainExam");

            migrationBuilder.DropTable(
                name: "SysPersonMedicalExam");

            migrationBuilder.DropTable(
                name: "SysPersonTrain");
        }
    }
}
